# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Maintainer: Daurnimator <daurnimator@archlinux.org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Daniel M. Capella <polyzen@archlinux.org>

pkgname=yq
pkgver=3.2.2
pkgrel=2
pkgdesc="Command-line YAML, XML, TOML processor - jq wrapper for YAML/XML/TOML documents"
arch=('any')
url="https://github.com/kislyuk/yq"
license=('Apache')
depends=('jq'
         'python-argcomplete'
         'python-tomlkit'
         'python-xmltodict'
         'python-yaml')
makedepends=('python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
conflicts=('go-yq')
source=("https://files.pythonhosted.org/packages/source/y/$pkgname/$pkgname-$pkgver.tar.gz")
sha256sums=('8dbb7a0c937ddbfc3dd175e6478f40960c140d3e8b1f1a0315de76384d66650a')
b2sums=('4386a7972b411159ed909ccdc7c32a878d064ac5101cbddb16b0f1efe37c3791aeefda3b7c18c94e7d79fb01a4a4b43f7fbcc7c55bd275c52e08cc069523c8d3')

build() {
  cd $pkgname-$pkgver
  python -m build -wn
}

check() {
  cd $pkgname-$pkgver
  python test/test.py
}

package() {
  cd $pkgname-$pkgver
  python -m installer -d "$pkgdir" dist/*.whl
}
